home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: n4jvp@ix.netcom.com (n4jvp)
- Newsgroups: comp.lang.c++
- Subject: Ctors & member methods ?
- Date: Fri, 19 Jan 1996 22:19:44 GMT
- Organization: Netcom
- Message-ID: <3100187d.5776685@ixnews7.ix.netcom.com>
- NNTP-Posting-Host: ix-nas-nh1-01.ix.netcom.com
- X-NETCOM-Date: Fri Jan 19 2:29:42 PM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- I have a question concerning ctors. Can a ctor call a member
- method?
-
- class Foo
- {
- public:
- Foo(){};
- Foo( int a );
- ~Foo(){};
- void setlist( Ptr * b, Ptr * w );
- private:
- ...
- };
-
- Foo::Foo( int a ) // a is a boolean value
- {
- for( int i=0; i<16; i++ )
- if( a ) // new data
- {
- do stuff and get 2 pointers;
- bar( Ptr * b, Ptr * w);
- }
- else // restored data
- {
- do other stuff and get 2 pointers;
- bar( Ptr * b, Ptr * w );
- }
- }
-
- void Foo::bar( Ptr * b, Ptr * w )
- {
- do more stuff;
- }
-
-